load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library")

package(default_visibility = ["//visibility:public"])

cc_binary(
    name = "libcamera_detection_component.so",
    linkshared = True,
    linkstatic = False,
    deps = [":camera_detection_component_lib"],
)

cc_library(
    name = "camera_detection_component_lib",
    srcs = glob([
        "*.cc",
    ]),
    hdrs = glob([
        "*.h",
    ]),
    deps = [
        "//air_service/modules/proto:perception_cc_pb",
        "//air_service/modules/perception-camera/algorithm/interface:camera_algorithm_interface",
        "//air_service/modules/perception-camera/algorithm/detector:detector_plugin_adapter",
        "//air_service/modules/perception-camera/algorithm/roi_filter:roi_filter_adapter",
        "//air_service/modules/perception-camera/algorithm/tracker:tracker_plugin_adapter",
        "//air_service/modules/perception-camera/algorithm/transformer:transformer_plugin_adapter",
        "//air_service/modules/perception-camera/proto:perception_camera_cc_pb",
        "//base/plugin:base_plugin",
        "//base/io:base_io",
        "//middleware/device_service/camera:mid_camera_service",
        "@protobuf_import//:protobuf_import",
        "@com_github_google_glog//:glog",
        "@fastrtps//:fastrtps",
        "@com_github_gflags_gflags//:gflags",
        "@airosrt//:airosrt",
        "@yaml_cpp//:yaml_cpp",
        "@jsoncpp//:jsoncpp",
        "@boost//:boost",
        "@atlas//:atlas",
    ],
    alwayslink = True,
)


cc_binary(
    name = "libcamera_detection_component_viz.so",
    linkshared = True,
    linkstatic = False,
    deps = [":camera_detection_component_lib_viz"],
)

cc_library(
    name = "camera_detection_component_lib_viz",
    defines = ["PERCEPTION_VIZ"],
    srcs = glob([
        "*.cc",
    ]),
    hdrs = glob([
        "*.h",
    ]),
    deps = [
        "//air_service/modules/perception-visualization/pipline:camera_visualiztion_component_lib",
        "//air_service/modules/proto:perception_cc_pb",
        "//air_service/modules/perception-camera/algorithm/interface:camera_algorithm_interface",
        "//air_service/modules/perception-camera/algorithm/detector:detector_plugin_adapter",
        "//air_service/modules/perception-camera/algorithm/roi_filter:roi_filter_adapter",
        "//air_service/modules/perception-camera/algorithm/tracker:tracker_plugin_adapter",
        "//air_service/modules/perception-camera/algorithm/transformer:transformer_plugin_adapter",
        "//air_service/modules/perception-camera/proto:perception_camera_cc_pb",
        "//base/plugin:base_plugin",
        "//base/io:base_io",
        "//middleware/device_service/camera:mid_camera_service",
        "@protobuf_import//:protobuf_import",
        "@com_github_google_glog//:glog",
        "@fastrtps//:fastrtps",
        "@com_github_gflags_gflags//:gflags",
        "@airosrt//:airosrt",
        "@yaml_cpp//:yaml_cpp",
        "@jsoncpp//:jsoncpp",
        "@boost//:boost",
        "@atlas//:atlas",
        "@eigen//:eigen",
    ],
    alwayslink = True,
)
